#include "stdafx.h"
#include "XeFindWnd.h"

CXeFindWnd::CXeFindWnd(HWND hWnd, CStringW strClassName)
	: m_hFindWnd(NULL)
	, m_strClassName(strClassName)

{
	EnumChildWndProc(hWnd, reinterpret_cast<LPARAM>(this));
}

CXeFindWnd::~CXeFindWnd()
{
}

BOOL CALLBACK CXeFindWnd::EnumChildWndProc(HWND hWnd, LPARAM lParam)
{
	CXeFindWnd *pThis = reinterpret_cast<CXeFindWnd*>(lParam);
	HWND hFindWnd = ::FindWindowEx(hWnd, NULL, pThis->m_strClassName, NULL);
	if (hFindWnd)
	{
		pThis->m_hFindWnd = hFindWnd;
		return FALSE;
	}

	::EnumChildWindows(hWnd, &CXeFindWnd::EnumChildWndProc, lParam);
	return TRUE;
}